<include file="Common/Api/header_new" />
<div class="container-fluid">
<include file="Common/Api/left_menu_new" />
  
  <div class="affix container_right">
  
  
    <div class="title"><a>生成API</a>&nbsp;&gt;&nbsp;数据库</div>
    
    <div class="container">
        <div class="tab-pane">
           <table class="table table-bordered table-striped margin-top">
          <colgroup>
            <col class="col-md-1">
            <col class="col-md-1">
            <col class="col-md-2">
            <col class="col-md-2">
            <col class="col-md-6">
          </colgroup>
            <thead>
            <tr>
              <th></th>
              <th>序号</th>
              <th>字段名称</th>
              <th>类型</th>
              <th>说明</th>
            </tr>
            </thead>
            
            <tbody>
                <foreach name="fields" item="vo">
                <tr class="init_tr_{$key+1}">
                  <td class="padding-35">
                    <label>
                      <if condition="empty($import_fields) eq true">
                        <input class="_view_checked" type="checkbox" checked="checked" value="{$key+1}" name="checkbox">
                      <else />
                        <input class="_view_checked" type="checkbox" <if condition="array_key_exists($vo,$import_fields)">checked="checked"</if> value="{$key+1}" name="checkbox">
                      </if>
                    </label>
                  </td>
                  <td><a>{$key+1}</a></td>
                  <td class="init_name_{$key+1}">{$vo}</td>
                  <td class="padding-3">
                  
                    <div class="btn-group" style="width:100%;">
                      <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" style="width:100%">
                        <if condition="array_key_exists($vo,$import_fields)">
                        <b class="_view_type_b_{$key+1}">{$import_fields[$vo]['type']}</b>
                        <else />
                        <b class="_view_type_b_{$key+1}">string</b>
                        </if>
                        <span class="caret"></span>
                      </button>
                      <ul class="dropdown-menu" aria-labelledby="dropdownMenu1" style="width:100%">
                        <li role="presentation" class="_dropdown_menu" data-key="{$key+1}" data-value="bool"><a href="#">bool</a></li>
                        <li role="presentation" class="_dropdown_menu" data-key="{$key+1}" data-value="number"><a href="#">number</a></li>
                        <li role="presentation" class="_dropdown_menu" data-key="{$key+1}" data-value="string"><a href="#">string</a></li>
                      </ul>
                    </div>   
                      
                  </td>
                  <td class="padding-3">
                    <if condition="array_key_exists($vo,$import_fields)">
                      <input type="text" data-key="{$key+1}" class="csvadd-input form-control _view_desc _init_desc_{$key+1}" placeholder="说明" value="{$import_fields[$vo]['desc']}">
                    <else />
                      <input type="text" data-key="{$key+1}" class="csvadd-input form-control _view_desc _init_desc_{$key+1}" placeholder="说明">
                    </if>
                  </td>
                </tr>
                </foreach>
            
               
            </tbody>
            
          </table>

            
        <button type="button" class="btn btn-info" onclick="javascript:history(-1);">上一步</button>
        <button type="button" class="btn btn-info" data-toggle="modal" data-target=".bs-example-modal-detail-csvadd-preview">预览</button>
        <button class="btn btn-primary csvadd-btn-margin text-left _fields_submit">确定</button>
        </div>
    
    
  </div>
</div>

<div class="modal fade bs-example-modal-detail-csvadd-preview" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
  <div class="modal-dialog modal-sm" style="width:80%">
    <div class="modal-content">
      <div class="modal-body text-center">
       <table class="table table-bordered">
          <colgroup>
            <col class="col-md-2">
            <col class="col-md-2">
            <col class="col-md-2">
            <col class="col-md-6">
          </colgroup>
            <thead>
            <tr>
              <th>序号</th>
              <th>字段名称</th>
              <th>类型</th>
              <th>说明</th>
            </tr>
            </thead>
            
            <tbody>
                <foreach name="fields" item="view" key="k">
                <tr id="view_tr_{$k+1}">
                  <td><a>{$k+1}</a></td>
                  <td>{$view}</td>
                  <td id="view_type_{$k+1}">
                    string
                  </td>
                  <td class="text-left" id="view_desc_{$k+1}"></td>
                </tr>
                </foreach>
            
               
            </tbody>
            
          </table>
      </div>
      <div class="modal-footer">
       <div class="row text-center">
        <button type="button" class="btn btn-primary" data-dismiss="modal">确定</button>
       </div>
      </div>
    </div>
  </div>
</div>

<input type="hidden" class="_file_id" value="{$id}" />
<script language="javascript" type="text/javascript" src="__PUBLIC__/home/dist/drag/tab.js"></script>
<script type="text/javascript" src="__PUBLIC__/home/js/filefieldrule.js"></script>
</body>
</html>
